package com.example.jpetstoremanager.service.impl;

import com.example.jpetstoremanager.entity.Log;
import com.example.jpetstoremanager.entity.Log0;
import com.example.jpetstoremanager.persistence.LogMapper;
import com.example.jpetstoremanager.service.LogService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogMapper logMapper;

    @Override
    public String logInfo(Object... s) {
        return Log0.logInformation(s);
    }

    @Override
    public void insertLogInfo(String username, String logInfo) {
        Log log = new Log();
        log.setLogUserId(username);
        log.setLogInfo(logInfo);
        logMapper.insert(log);
    }
}
